/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.sd.chat;

/**
 *
 * @author Formação
 */
public class Logger {

    private boolean logOn = true;
    private int erros = 0;
    private int msgs = 0;

    public Logger(boolean logStatus){
        this.logOn = logStatus;
    }

    public void out(String toLog){
        if(this.logOn)
            System.out.print(toLog);
    }

    public void outln(String toLog){
        if(this.logOn)
            System.out.println("Msg "+(msgs++)+":"+toLog);
    }

    public void erro(String toLog){
        if(this.logOn)
            System.out.println("Erro "+(erros++)+": "+toLog);
    }

}
